<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>Kepler: The Lua Web Development Platform</title>
    <link rel="stylesheet" href="http://www.keplerproject.org/doc.css" type="text/css"/>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>

<body>

<div id="container">

<div id="product">
	<div id="product_logo"><a href="http://www.keplerproject.org">
		<img alt="Kepler" src="kepler.png"/>
	</a></div>
	<div id="product_name"><big><strong>Kepler</strong></big></div>
	<div id="product_description">The Lua Web Development Platform</div>
</div> <!-- id="product" -->

<div id="main">
	
<div id="navigation">
<h1>Kepler</h1>
	<ul>
		<li><a href="index.html">Home</a>
			<ul>
				<li><a href="index.html#overview">Overview</a></li>
				<li><a href="index.html#status">Status</a></li>
				<li><a href="index.html#download">Download</a></li>
				<li><a href="index.html#history">History</a></li>
				<li><a href="index.html#credits">Credits</a></li>
				<li><a href="index.html#contact">Contact us</a></li>
			</ul>
		</li>
		<li><a href="install.html">Installation</a>
            <ul>
                <li><a href="install.unix.html">Unix/OSX</a></li>
                <li><a href="install.windows.html">Windows</a>
                    <ul>
                        <li><a href="install.windows.html#installer">Installer</a></li>
                        <li><a href="install.windows.html#directories">Directories</a></li>
                        <li><a href="install.windows.iis.html">IIS</a></li>
                        <li><strong>Apache 2</strong></li>
                        <li><a href="install.windows.xavante.html">Xavante</a></li>
                    </ul>
                </li>
            </ul>
        </li>
        <li><a href="manual.html">Manual</a>
			<ul>
				<li><a href="manual.html#introduction">Introduction</a></li>
				<li><a href="manual.html#configuration">Configuration</a></li>
			</ul>
		</li>
		<li><a href="reference.html">Reference</a></li>
		<li><a href="examples.html">Examples</a></li>
        <li><a href="http://luaforge.net/projects/kepler/">Project</a>
            <ul>
                <li><a href="bugtracker.html">Bug Trackers</a></li>
                <li><a href="http://luaforge.net/scm/?group_id=104">CVS</a></li>
            </ul>
        </li>
		<li><a href="license.html">License</a></li>
	</ul>
</div> <!-- id="navigation" -->

<div id="content">

<h2>Using Kepler with Apache 2.0 in Windows</h2>

<p>Using Kepler with Apache 2.0 in Windows involves one the following launchers:</p>

<ul>
	<li><a href="#mod">mod_lua</a></li>
	<li><a href="#fastcgi">FastCGI</a></li>
	<li><a href="#cgi">CGI</a></li>
</ul>

<h2><a name="mod"></a>mod_lua</h2>

<p>mod_lua allows the use of the Apache native API. This is usually the best 
option to run Kepler with Apache Server.</p>

<p>The Apache installation directory will be refered here as APACHE_DIR. 
In Windows this is by default the diretory 
<code>%PROGRAMFILES%\Apache Group\Apache2</code>. It is also assumed here that 
the Kepler installation directory is at <code>&lt;<em>Kepler Home</em>&gt;</code>.</p>

<p>
The first step is to copy all
<a href="install.windows.html#dependencies">dependent libraries</a> 
to the directory <code>APACHE_DIR\bin</code>.
</p>

<p>Then you have to open the Apache configuration file
(<code>APACHE_DIR\conf\httpd.conf</code>) on your editor, search for a 
series of <code>LoadModule</code> directives and add the following one:</p>

<pre class="example">
LoadModule lua_module "C:/Kepler/1.1/bin/mod_lua.so"
</pre>

<p>At the end of the configuration file add the following section:</p>

<pre class="example">
# Lua module for Apache2 configuration file.
LoadModule lua_module modules/mod_lua.so

&lt;IfModule mod_lua.c&gt;
    # Definition of file types
    AddHandler lua_module .lua
    AddHandler lua_module .lp
    # Definition of Lua module handlers for file types
    LuaHandler lua_module
&lt;/IfModule&gt;
</pre>

<p>Save the file and restart Apache. This configuration will run Kepler 
with every <code>.lua</code> or <code>.lp</code> file.</p>

<p>If your Apache is a Kepler-only server you can change the DocumentRoot 
to point to the Kepler web dir. Change the following section in your Apache
configuration file.</p>

<pre class="example">
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
#DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
DocumentRoot "C:/Kepler/1.1/web"
</pre>

<pre class="example">
#
# This should be changed to whatever you set DocumentRoot to.
#
#&lt;Directory "C:/Program Files/Apache Group/Apache2/htdocs"&gt;
&lt;Directory "C:/Kepler/1.1/web"&gt;
</pre>

<h2><a name="fastcgi"></a>FastCGI</h2>

<p>FastCGI is also a good option for Kepler on an Apache 2 Server. You need to have mod_fcgid, the
new FastCGI module for Apache. To use Kepler as a FastCGI application, you have to configure Apache
to associate <code>.lua</code> and <code>.lp</code> extensions with the Kepler FastCGI launcher.
Edit the Apache configuration file to include the following:</p>

<pre class="example">
&lt;IfModule mod_fcgid.c&gt;
  SocketPath c:\Kepler\1.1\tmp\kepler-fcgi
  AddHandler fcgid-script .lua .lp
  FCGIWrapper c:\Kepler\1.1\bin\fastcgi .lua
  FCGIWrapper c:\Kepler\1.1\bin\fastcgi .lp
&lt;/IfModule&gt;
</pre>

<p>If you want your Apache configured as a Kepler-only server you can change the
<code>DocumentRoot</code> to point to the Kepler web directory. Change the following
sections in your Apache configuration file:</p>

<pre class="example">
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "c:\Kepler\1.1\web"

...

#
# This should be changed to whatever you set DocumentRoot to.
#
&lt;Directory "c:\Kepler\1.1\web"&gt;
</pre>

<p>
For further information check 
<a href="http://fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html">mod_fastcgi documentation</a>.
</p>

<h2><a name="cgi"></a>CGI</h2>

<p>Kepler can be used as a standard Apache CGI application.</p>

<p>This part of the documentation is still under development.</p>

</div> <!-- id="content" -->

</div> <!-- id="main" -->

<div id="about">
	<p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
	<p><small>$Id: install.windows.apache2.html,v 1.15 2007/09/07 21:24:50 carregal Exp $</small></p>
</div> <!-- id="about" -->

</div> <!-- id="container" -->

</body>
</html>










